//
//  DKEssenceViewController.m
//  BSBDJ
//
//  Created by 丁侃 on 16/4/23.
//  Copyright © 2016年 丁侃. All rights reserved.
//

#import "DKEssenceViewController.h"

@interface DKEssenceViewController ()

@end

@implementation DKEssenceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = DKColorRandom;
    
    //添加标题
    self.navigationItem.titleView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];
    
    //添加左按钮
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTargrt:self action:@selector(showTagBtnClick) imageName:@"MainTagSubIcon" highlightImageName:@"MainTagSubIconClick"];
}

//抽取添加item的功能的方法
-(UIBarButtonItem *) itemWithTargrt:(id) target action:(SEL)action imageName:(NSString *)imageName highlightImageName:(NSString *)highlightImageName
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:highlightImageName] forState:UIControlStateHighlighted];
    
    [btn sizeToFit];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[UIBarButtonItem alloc]initWithCustomView:btn];
}


-(void)showTagBtnClick
{
    DKLogFunc
}


@end
